-- ================================START====================================
-- Template generated from		FRAMEWORKIVY CODE GENERATOR
-- Generator Version:			<1.0.0.0>
-- Template Creation Time:		<Saturday, 13 August, 2016   12:39:28 AM>
-- Template Modification Time:	<Sunday, 4 September, 2016   12:40:01 AM>
-- Code Generation Time:		<Monday, 12 September, 2016   10:01:47 PM>
-- Workstation ID:				<PRAVESH>
-- Current system User ID:		<pravesh>
-- Entity/Table Name:			<ContentChoiceResponse>
-- Description:					<SQL Server Stored Procedure For Insert>
-- Template File:				<IvyGodeGenDefaultTemplate V1.1.xml>

-- Please modify the generated code as per requirement.
-- This code generator is just to speed up the stereo type codes
-- Complex logic needs to be modified manually.

-- This block of comments will not be included in
-- the definition of the procedure.
-- =========================================================================

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Ivy_ContentManagement_ContentChoiceResponse_Insert')
	BEGIN
		DROP  Procedure  [Ivy_ContentManagement_ContentChoiceResponse_Insert]
	END
GO

CREATE PROCEDURE [Ivy_ContentManagement_ContentChoiceResponse_Insert]
-- =========================================================================
-- Created by				FRAMEWORKIVY CODE GENERATOR
-- Generator Version:		<1.0.0.0>
-- Template version used:   <1.0>
-- Template created by:		<Mrinmoy Das>
-- Code generated by:		<pravesh>
-- Code generation Time:	<Monday, 12 September, 2016   10:01:47 PM>
-- Entity/Table Name:		<ContentChoiceResponse>
-- Description:             <SQL Server Stored Procedure For Insert>
-- =========================================================================
-- If Code has been MANUALLY MODIFIED then set below line to TRUE
-- CODE MANUALLY MODIFIED = FALSE
-- =========================================================================

-- Add the parameters for the stored procedure here

	(
				@ContentChoiceKey int = NULL, 
				@ContentChoiceResponseUserKey int = NULL, 
				@ContentChoiceResponseText varchar(MAX) = NULL, 
				@ContentChoiceResponsekDate datetime = NULL, 
				@ContentChoiceResponseUserName varchar(150) = NULL, 
				@ContentChoiceResponseUserEmail varchar(150) = NULL, 

				@Sys_CreatedByID varchar(50) = NULL, 
				@Sys_ModifiedByID varchar(50) = NULL, 
				@Sys_DeleteType int = NULL, 
				@Sys_IsDeleted bit = 0, 
				@Sys_OrganizationID int = NULL, 
				@Sys_InitialPrimaryKeys varchar(MAX) = NULL, 
				@Sys_WorkstationName varchar(50) = NULL, 


				@Sys_DateOfCreation datetime OUTPUT 
	)
AS
BEGIN
	-- SET NOCOUNT OFF added to indicate how many records are inserted 
	SET NOCOUNT OFF;

	IF @Sys_WorkstationName = 'Default'	
	BEGIN
		SET @Sys_WorkstationName = (SELECT @@SERVERNAME);
	END

	SET @Sys_DateOfCreation = GETDATE();

    INSERT INTO [ContentChoiceResponse]
           (
				[ContentChoiceKey],
				[ContentChoiceResponseUserKey],
				[ContentChoiceResponseText],
				[ContentChoiceResponsekDate],
				[ContentChoiceResponseUserName],
				[ContentChoiceResponseUserEmail],

				[Sys_DateOfCreation],
				[Sys_DateOfModification],
				[Sys_CreatedByID],
				[Sys_ModifiedByID],
				[Sys_DeleteType],
				[Sys_IsDeleted],
				[Sys_OrganizationID],
				[Sys_InitialPrimaryKeys],
				[Sys_WorkstationName]
           )
     VALUES
           (
				@ContentChoiceKey, 
				@ContentChoiceResponseUserKey, 
				@ContentChoiceResponseText, 
				@ContentChoiceResponsekDate, 
				@ContentChoiceResponseUserName, 
				@ContentChoiceResponseUserEmail, 

				@Sys_DateOfCreation, 
				@Sys_DateOfCreation, 
				@Sys_CreatedByID, 
				@Sys_CreatedByID, 
				@Sys_DeleteType, 
				@Sys_IsDeleted, 
				@Sys_OrganizationID, 
				@Sys_InitialPrimaryKeys, 
				@Sys_WorkstationName 
           );

END
GO

-- =================================END=====================================

